CREATE TABLE [dbo].[TTPROC_INPL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_PROC] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TTPROC_IN__NU_PR__7E6CC920] DEFAULT ((0)),
[NU_ANNO] [dbo].[TD_IN_004_ANOS] NOT NULL CONSTRAINT [DF__TTPROC_IN__NU_AN__7F60ED59] DEFAULT (datepart(year,getdate())),
[NU_MESE] [dbo].[TD_IN_002_MESE] NOT NULL,
[CO_GRUP] [dbo].[TD_VC_003] NULL,
[CO_ASIE] [dbo].[TD_VC_003] NULL,
[CO_UNID_INIC] [dbo].[TD_VC_003] NOT NULL,
[CO_UNID_FINA] [dbo].[TD_VC_003] NOT NULL,
[CO_PLAN_INIC] [dbo].[TD_VC_003] NOT NULL,
[CO_PLAN_FINA] [dbo].[TD_VC_003] NOT NULL,
[ST_MEPE] [dbo].[TD_VC_001] NULL,
[NU_PERI] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTPROC_IN__NU_PE__023D5A04] DEFAULT ((0)),
[NU_CORR_PERI] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTPROC_IN__NU_CO__03317E3D] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTPROC_IN__FE_US__0425A276] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTPROC_IN__FE_US__0519C6AF] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTPROC_INPL] WITH NOCHECK ADD CONSTRAINT [CK__TTPROC_IN__NU_AN__00551192] CHECK NOT FOR REPLICATION (([NU_ANNO]>(1850)))
GO
ALTER TABLE [dbo].[TTPROC_INPL] WITH NOCHECK ADD CONSTRAINT [CK__TTPROC_IN__NU_ME__014935CB] CHECK NOT FOR REPLICATION (([NU_MESE]>=(0) AND [NU_MESE]<=(13)))
GO
ALTER TABLE [dbo].[TTPROC_INPL] ADD CONSTRAINT [PK__TTPROC_I__21DF78165070F446] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_PROC]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTPROC_INPL] ADD CONSTRAINT [FK__TTPROC_INPL__5812160E] FOREIGN KEY ([CO_EMPR], [NU_PROC]) REFERENCES [dbo].[TTPROC_INTE] ([CO_EMPR], [NU_PROC])
GO
